package com.appjishu.web.biz.dao;

import com.appjishu.web.model.Ranking;
import com.appjishu.web.model.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

/** 
* @author echo(goldliclass@163.com)
* @version 创建时间：2022年8月26日 下午8:45:39 
* 类说明 
*/
@Mapper
public interface UserMapper extends BaseMapper<User>{
	User getUserByMobile(@Param("mobile") String mobile);
	User getUserByEmail(@Param("email") String email);

	User getUserByStuNumber(@Param("stuNumber") String stuNumber);

	Integer exist(@Param("field") String field, @Param("fieldValue") String fieldValue);

	void changePassword(@Param("password") String password,@Param("userId") Long userId);

    void totalScore(@Param("userId")Long userId,@Param("point") int point);

	User selectAll (@Param("userId")Long userId);
	String selectName (@Param("userId")Long userId);

	Integer batchInsetUser(List<User> list);

	List<Ranking> rankingByAll();
	List<Ranking> rankingByCollegeId(@Param("collegeId") Long collegeId);

	List<Ranking> rankingBySpecialityId(@Param("specialityId") Long specialityId);

	List<Ranking> rankingByClassId(@Param("classId") Long classId);

	Integer setLoginInformation(@Param("userId") Long userId, @Param("loginTime") Timestamp loginTime, @Param(
			"onlineTimes") Long onlineTimes, @Param("deviceType") String deviceType);

	Integer setDownLineInformation(@Param("userId") Long userId, @Param("downlineTime") Timestamp downlineTime,
								   @Param("duration") Long duration, @Param("allDuration") Long allDuration);

	void setLoginDownInformation(@Param("userId") Long userId, @Param("loginTime") Timestamp loginTime, @Param(
			"onlineTimes") Long onlineTimes, @Param("deviceType") String deviceType,
								 @Param("downlineTime") Timestamp downlineTime, @Param("duration") Long duration,
								 @Param("allDuration") Long allDuration);

	void batchInsetUserNew(List<User> list);

	void setUserInformation(@Param("userId") Long userId, @Param("loginTime") Timestamp loginTime, @Param(
			"downlineTime") Timestamp downlineTime, @Param("deviceType") String deviceType,
							@Param("duration") Long duration);

}
